# -*- encoding=utf8 -*-
"""
RedFlag-TC000064   暂停中调试快慢速
拍摄暂停后使用快慢速场景
"""
__author__ = "ldm"

import sys
import os

# 获取当前脚本所在目录.py
current_dir = os.path.dirname(os.path.abspath(__file__))
# 获取上级目录.air
parent_dir = os.path.dirname(current_dir)
# 获取上级目录air
grandparent_dir = os.path.dirname(parent_dir)
# 获取和air目录平级的conf、testcase目录路径
conf_dir = os.path.join(grandparent_dir, 'conf')
testcase_dir = os.path.join(grandparent_dir, 'testcase')
# 将conf、testcase目录添加到sys.path
sys.path.append(conf_dir)
sys.path.append(testcase_dir)

from PageFunction import CameraVideoShooter
from elements import *
auto_setup(__file__)

shooter = CameraVideoShooter()

log("--------------------------------拍摄暂停后使用快慢速场景--------------------------------------")
"""
进入相机拍摄
点击两次拍摄按钮
点击快慢速
依次应用快慢速拍摄一段视频
断言图片
点击下一步
断言
"""

shooter.enter_photograph()
shooter.click_element(shooting_page_60_seconds)
shooter.multiple_dense_clicks(shooting_button, 2, 0.5)
shooter.click_element(shooting_page_fast_slow_speed)
shooter.click_element(fast_slow_speed_extremely_slow)
shooter.multiple_dense_clicks(shooting_button, 2, 0.5)
shooter.click_element(fast_slow_speed_slow)
shooter.multiple_dense_clicks(shooting_button, 2, 0.5)
shooter.click_element(fast_slow_speed_standard)
shooter.multiple_dense_clicks(shooting_button, 2, 0.5)
shooter.click_element(fast_slow_speed_fast)
shooter.multiple_dense_clicks(shooting_button, 2, 0.5)
shooter.click_element(fast_slow_speed_extremely_fast)
shooter.assert_image_exists(r"tpl1747224663854.png", "断言失败，图片并未出现", record_pos=(0.004, 0.401), resolution=(1224, 2700))
shooter.click_element(shooting_page_next_button)
shooter.assert_element_exists(decoration_page_release_video, "断言失败，并未定位到指定元素")

# 关闭应用
stop_app(UGC_package_name)